<?php

declare(strict_types=1);

namespace app\admin\validate;

use think\Validate;

class DictionaryValue extends Validate
{
     /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...].
     *
     * @var array
     */
    protected $rule = [
        'value_id' => 'require|number|gt:0',
        'dictionary_id' => 'require|number|gt:0',
        'label' => 'require|min:2',
        'value' => 'require|number|egt:0',
        'sort' => 'require|number|gt:0',
        'page' => 'require|number|gt:0',
        'limit' => 'require|number|gt:5',
    ];
    protected $scene = [
        'getDictionaryValueListPage' => ['page', 'limit'],
        'saveDictionaryValueAdd' => ['dictionary_id', 'label', 'value', 'sort'],
        'getDictionaryValueRow' => ['value_id'],
        'saveDictionaryValueEdit' => ['value_id'],
        'saveDictionaryValueDel' => ['value_id'],
    ];
}